package com.heima.comment.controller;

import com.heima.comment.service.CommentRepayService;
import com.heima.model.comment.dtos.CommentRepayDto;
import com.heima.model.comment.dtos.CommentRepayLikeDto;
import com.heima.model.comment.dtos.CommentRepaySaveDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author luoTao
 * @project xmsz
 * @date 2024/1/27 14:15:26
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/comment_repay")
public class CommentRepayController {
    @Autowired
    private CommentRepayService commentRepayService;

    @PostMapping("/load")
    public ResponseResult<?> loadCommentRepay(@RequestBody CommentRepayDto dto){
        System.out.println("load方法");
        return commentRepayService.loadCommentRepay(dto);
    }

    @PostMapping("/save")
    public ResponseResult<?> saveCommentRepay(@RequestBody CommentRepaySaveDto dto){
        System.out.println("save方法");
        return commentRepayService.saveCommentRepay(dto);
    }

    @PostMapping("/like")
    public ResponseResult<?> saveCommentRepayLike(@RequestBody CommentRepayLikeDto dto){
        System.out.println("like方法");
        return commentRepayService.saveCommentRepayLike(dto);
    }
}
